package com.liukai.bishe.ui.fragment;

import android.content.Context;
import android.view.View;

import com.liukai.bishe.R;
import com.liukai.bishe.model.doman.transaction.TransactionUseTime;
import com.liukai.bishe.ui.adapter.StateRecyclerViewAdapter;
import com.liukai.bishe.ui.decoration.UserInfoDecoration;
import com.liukai.bishe.utils.Constants;

import java.util.List;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;

public class StateFragment extends BaseFragment {


    private Context mContext;

    @BindView(R.id.recyclerView)
    public RecyclerView mRecyclerView;

    @Override
    protected Context getFragmentContext(View view) {
        this.mContext = view.getContext();
        return null;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_state;
    }

    @Override
    protected void initListener() {
        super.initListener();
    }

    @Override
    protected void initAdapter(View view) {
        super.initAdapter(view);
        List<TransactionUseTime> transactionUseTimeList = Constants.getTransactionUseTimeList();
        StateRecyclerViewAdapter stateRecyclerViewAdapter = new StateRecyclerViewAdapter(transactionUseTimeList,mContext);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mContext);
        mRecyclerView.addItemDecoration(new UserInfoDecoration());
        mRecyclerView.setLayoutManager(linearLayoutManager);
        mRecyclerView.setAdapter(stateRecyclerViewAdapter);

    }

}
